import { BoxModel, BoxProfileModel } from '../model/box';
import ProxyInterface from '../proxy-interface';

class BoxProxy implements ProxyInterface<BoxModel> {
  public boxModel = new BoxModel();

  constructor (responseData) {
    let data = responseData.data || responseData;
    Object.assign<BoxModel, any>(this.boxModel, data);
  }

  getModel (): BoxModel {
    return this.boxModel;
  }
}

class BoxProfileProxy implements ProxyInterface<BoxProfileModel> {
  private boxProfile = new BoxProfileModel();

  constructor (responseData) {
    let data = responseData.data || responseData;
    Object.assign<BoxProfileModel, any>(this.boxProfile, data);
  }

  getModel (): BoxProfileModel {
    return this.boxProfile;
  }
}

export {
  BoxProxy,
  BoxProfileProxy
};
